package com.ituhh.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Mensa {
	public static List<String> format(String input)
	{
		String tmpstring="";
		Scanner regx=new Scanner(input).useDelimiter("<td");
	    List<String> meallist = new ArrayList<String>();
		while(regx.hasNext()){
			tmpstring=regx.next();
			tmpstring=tmpstring.replaceAll("</b><br><span class=\"fliesstextklorange\">", "[");
			tmpstring=tmpstring.replaceAll("</span></p>.*", "]");
			tmpstring=tmpstring.replaceAll("</span><br>.*", "]");						
			tmpstring=tmpstring.replaceAll(".*<b>", "");
			tmpstring=tmpstring.replaceAll("</b>.*", "");
			tmpstring=tmpstring.replaceAll("&szlig;", "ß");
			tmpstring=tmpstring.replaceAll("&auml;", "ä");
			tmpstring=tmpstring.replaceAll("&ouml;", "ö");
			tmpstring=tmpstring.replaceAll("&uuml;", "ü");
			tmpstring=tmpstring.replaceAll(".*>.*", "");
			tmpstring=tmpstring.replaceAll("es - s.*", "es - süß");
			meallist.add(tmpstring);
		}
		return(meallist);
	}
}

